﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Daybook.aspx.cs" Inherits="Web.Daybook" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">

    <link rel="stylesheet" href="Share/Styles/Daybook.css" />

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Main" runat="server">


    <section runat="server" id="JournalFiters" class="inset-shadow box clear-fix filter">

        <div class="wrapper left">
            <asp:DropDownList runat="server" ID="DdlSemesters" AutoPostBack="True" OnSelectedIndexChanged="DdlSemesters_OnSelectedIndexChanged" />
        </div>

        <% if (PermissionService.CanViewAnyDaybook())
           {%>
        <div class="wrapper left">
            <asp:DropDownList runat="server" ID="DdlStudents" AutoPostBack="True" OnSelectedIndexChanged="DdlStudents_OnSelectedIndexChanged" />
        </div>
        <% } %>
    </section>


    <section id="Daybook" class="clear-fix">

        <header class="clear-fix">
            <h3 class="left">
                <a href="#"><%= SelectedStudent.UserProfile.Fio %> </a>
                (<a href='Groups.aspx?GroupId=<%=SelectedStudent.Group.Id %>'><%= SelectedStudent.Group.Name %></a>)
            </h3>
        </header>

        <div id="PrevNextWeek" class="inset-shadow box clear-fix">
            <div class="side left">
                <asp:HyperLink runat="server" ID="LinkPrevWeek" Text="Предыдущая неделя"></asp:HyperLink>
            </div>
            <div class="center left">
                <%=SelectedWeek %>-я неделя
            </div>
            <div class="side right">
                <asp:HyperLink runat="server" ID="LinkNextWeek" Text="Следующая неделя"></asp:HyperLink>
            </div>
        </div>

        <asp:ListView runat="server" ID="ListViewDaybookWeek" DataKeyNames="DayNo" OnItemDataBound="ListViewDaybookWeek_OnItemDataBound">

            <LayoutTemplate>

                <asp:PlaceHolder ID="ItemPlaceholder" runat="server" />

            </LayoutTemplate>

            <ItemTemplate>

                <article class="daybook-day inset-shadow box border-bottom-white clear-fix">
                    <header>
                        <h3 class="left"><%# Eval("DayName") %>
                        </h3>
                        <p class="left"><time datetime='<%# Eval("DateFormatted") %>'><%# Eval("Date") %></time></p>
                    </header>

                    <asp:ListView runat="server" ID="ListViewDaybookDay">

                        <LayoutTemplate>
                            <table class="table-bordered">
                                <thead>
                                    <tr>
                                        <th>№</th>
                                        <th>Предмет</th>
                                        <th>Домашнее задание</th>
                                        <th>Оценка</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:PlaceHolder ID="ItemPlaceholder" runat="server" />
                                </tbody>
                            </table>
                        </LayoutTemplate>

                        <ItemTemplate>

                            <tr>
                                <td><%# Eval("PairNo") %></td>
                                <td>
                                    <%# Eval("SubjectName") %>
                                    (<small><%# Eval("SubjectType") %></small>)
                                </td>
                                <td><%# Eval("Homework") %></td>
                                <td><%# Eval("Mark") %></td>
                            </tr>

                        </ItemTemplate>

                    </asp:ListView>

                </article>

            </ItemTemplate>

        </asp:ListView>

    </section>

</asp:Content>
